package com.ljf.daily.makemoneysoftware.infra.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.infra.repository.impl.BasisRepositoryImpl;
import com.ljf.common.utils.CollectionUtil;
import com.ljf.daily.makemoneysoftware.domain.repository.DailyDatMakeMoneySoftwareConfigRepository;
import com.ljf.daily.makemoneysoftware.dto.query.DailyDatMakeMoneySoftwareConfigQuery;
import com.ljf.daily.makemoneysoftware.infra.mapper.DailyDatMakeMoneySoftwareConfigMapper;
import com.ljf.daily.makemoneysoftware.model.DailyDatMakeMoneySoftwareConfig;
import com.ljf.daily.makemoneysoftware.vo.DailyDatMakeMoneySoftwareConfigVO;
import org.springframework.stereotype.Component;

/**
 * 赚钱软件配置  数据访问接口实现
 *
 * @author LJF
 * @since 2025-10-10
 */
@Component
public class DailyDatMakeMoneySoftwareConfigRepositoryImpl extends BasisRepositoryImpl<DailyDatMakeMoneySoftwareConfigMapper, DailyDatMakeMoneySoftwareConfig, DailyDatMakeMoneySoftwareConfigQuery, DailyDatMakeMoneySoftwareConfigVO> implements DailyDatMakeMoneySoftwareConfigRepository {

    @Override
    protected QueryWrapper<DailyDatMakeMoneySoftwareConfig> fillWrapper(DailyDatMakeMoneySoftwareConfigQuery query, boolean sort) throws ServiceException {
        QueryWrapper<DailyDatMakeMoneySoftwareConfig> wrapper = super.fillWrapper(query, sort);
        if (CollectionUtil.isNotEmpty(query.getCodeList())) {
            wrapper.in(DailyDatMakeMoneySoftwareConfig.COL_CODE, query.getCodeList());
        }
        return wrapper;
    }

}
